package com.bw.mapper;

import com.bw.domain.Role;
import com.bw.domain.TbMenu;
import com.bw.domain.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: zhaijiaqi
 * @Date: 2025/3/12 18:36
 * @Description:
 **/
public interface UserMapper {

    User getlogin(String username);

    List<Role> getrolelist(Integer id);

    User getuser(Integer id);

    List<TbMenu> getmenulist(Integer id);

    List<User> list(User user);

    void addrole(Role role);

    void deleteByroleid(Integer id);

    void insertroleMenu(@Param("roleId") Integer id,@Param("menuId") String s);

    Role getrole(String roleName);

    List<Integer> getmenuByroleId(Integer id);

    @Select("select * from t_role ")
    List<Role> getallrole();

    @Select("select * from t_user where username=#{username}")
    User checkusername(String username);

    Integer add(User user);

    void inserusrerrole(User user);
}
